package o;

import android.text.TextUtils;
import androidx.annotation.NonNull;
import com.huawei.appgallery.assistantdock.base.externalaction.openviewaction.RemoteBuoyAction;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.gamebox.plugin.gameservice.bean.GameInfo;
import com.huawei.hms.support.api.entity.hwid.HwIDConstant.RETCODE;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import java.util.LinkedHashMap;
import o.cim.a;

public abstract class beq {
    public static void ˋ(String str, String str2) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("service_type", String.valueOf(4));
        linkedHashMap.put("mode", str);
        linkedHashMap.put("switch_mode", str2);
        linkedHashMap.put("package_name", ˎ());
        dgh.ˋ("action_buoy_mode", linkedHashMap);
    }

    public static void ˎ(@NonNull BaseCardBean baseCardBean) {
        cil.ˋ(null, new a(baseCardBean).ˏ(String.valueOf(4)).ˋ());
    }

    public static void ˊ(@NonNull String str) {
        if (!TextUtils.isEmpty(str)) {
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            linkedHashMap.put("service_type", String.valueOf(4));
            linkedHashMap.put(RemoteBuoyAction.REMOTE_BUOY_URI, str);
            linkedHashMap.put("package_name", ˎ());
            dgh.ˋ("action_buoy_card", linkedHashMap);
        }
    }

    public static void ˋ(int i, String str, String str2) {
        switch (i) {
            case 2000:
            case RETCODE.SIGN_IN_PARAMS_ERROR /*2003*/:
                ॱ("action_restore_result", str, str2, 1);
                return;
            case 2001:
                ॱ("action_restore_install_result", str, str2, 1);
                return;
            case 2101:
                ॱ("action_restore_result", str, str2, 0);
                return;
            case 2102:
            case 2103:
                ॱ("action_restore_install_result", str, str2, 0);
                return;
            case 2300:
                ॱ("action_restore_confirm", str, str2, 1);
                return;
            case 2301:
                ॱ("action_restore_confirm_install", str, str2, 1);
                return;
            case 2400:
                ˏ("action_restore_start", str, str2);
                return;
            case 2401:
                ॱ("action_restore_confirm", str, str2, 0);
                return;
            case 2403:
                ˏ("action_restore_start_install", str, str2);
                return;
            case 2404:
                ॱ("action_restore_confirm_install", str, str2, 0);
                return;
            default:
                return;
        }
    }

    private static void ˏ(String str, String str2, String str3) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("packageName", str2);
        linkedHashMap.put("from", str3);
        dgh.ˋ(str, linkedHashMap);
    }

    private static void ॱ(String str, String str2, String str3, int i) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("packageName", str2);
        linkedHashMap.put(HiAnalyticsConstant.BI_KEY_RESUST, String.valueOf(i));
        linkedHashMap.put("from", str3);
        dgh.ˋ(str, linkedHashMap);
    }

    public static void ˏ(String str, String str2, String str3, String str4) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("func_uri", str3);
        linkedHashMap.put("func_type", str);
        linkedHashMap.put("func_value", str2);
        linkedHashMap.put("mode", str4);
        linkedHashMap.put("service_type", String.valueOf(4));
        linkedHashMap.put("package_name", ˎ());
        dgh.ˋ("action_buoy_service", linkedHashMap);
    }

    public static String ˎ() {
        fae ˏ = fam.ॱ().ˏ();
        if (ˏ == null) {
            return null;
        }
        GameInfo gameInfo = ˏ.getGameInfo();
        if (gameInfo != null) {
            return gameInfo.getPackageName();
        }
        return null;
    }
}
